package com.bdqn.demo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 系统用户
 *
 * @author LILIBO
 * @since 2021-11-22
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "sys_user")
@NamedQueries(@NamedQuery(name = "SysUser.findUsersByName", query = "select u from SysUser u where u.usrName = ?1"))
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "usr_id")
    private Long usrId;

    /**
     * 姓名
     */
    @Column(name = "usr_name")
    private String usrName;

    /**
     * 密码
     */
    @Column(name = "usr_password")
    private String usrPassword;

    /**
     * 角色编号
     */
    @Column(name = "usr_role_id")
    private Long usrRoleId;

    /**
     * 状态
     */
    @Column(name = "usr_flag")
    private Long usrFlag;

    public SysUser(String usrName, String usrPassword, Long usrRoleId, Long usrFlag) {
        this.usrName = usrName;
        this.usrPassword = usrPassword;
        this.usrRoleId = usrRoleId;
        this.usrFlag = usrFlag;
    }
}
